<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
         var arr1 = [1, 2, 3]
        var arr2 = [4, 5, 6]
        console.log(arr1.concat(arr2))
        console.log(arr1.concat(100))

        var arr3 = [1, 2, 3, 4]
        console.log(arr3.join('&'))

        console.log(
            arr3.toString()
        )

        console.log(arr3.indexOf(2))
        console.log(arr3.lastIndexOf(2))

        var arr4 = [100, 200, 3, 2, 1]
        console.log(arr4.includes(100))

        var arr5 = [100, 200, 300, 400, 500]
        console.log(arr5.indexOf(20000))
        console.log(arr5.includes(100))

        var arr6 = [1, 2, 3, 4, 5]

        var arr7 = [1, 2, [3, 4]]

        var arr8 = [1, 2, [3, 4[5, 6, [100, 200, [300, 400]]]]]  //[1,2,3,4,5,6] 
        console.log(arr8.flat(Infinity))

        for (var i = 0; i < 100; i++) {

        }
        var arr10 = [100, 200, 300, 400, 500, 600]
        arr10.forEach(function (item, index) {
            console.log(item, index)
        })
        var arr11 = [[1, 2], [3, 4], [5, 6], [7, 8]]
        arr11.forEach(function (item, index) {
            item.forEach(function (item1) {
                console.log(item1)
            })
        })

        for (var i = 0; i < arr11.length; i++) {
            for (var j = 0; j < arr11[i].length; j++) {
                console.log(arr11[i][j])
            }
        }

        var arr12 = [100, 200, 300, 400, 500, 600]
        console.log(arr12.some(function (item, index) {
            console.log(item)
            return item > 300
        }))

        console.log(
            arr12.every(function (item, index) {
                console.log(item)
                return item > 300
            })
        )

        console.log(
            arr12.filter(function (item, index) {
                return item % 2 == 0
            })
        )
         console.log(
            arr12.map(function (item, index) {
                return item / 2
            })
        )
        var arr13 = [100, 200, 300, 400]
        console.log(
            arr13.reduce(function (pre, item, index) {
                console.log(pre, item, index)
                return pre + item
            },0)
        )

        var arr14 = ['a', 'b', 'c', 'd', 'e']
        console.log(
            arr14.reduce(function(pre,item,index){
                return pre + item
            }, ' ')
        )
    </script>
</body>
</html>